﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Zero.Code;
using Zero.Model;
using Zero.BLL;

namespace Zero.Framework.Areas.SystemManage.Controllers
{
    public class StudentManagementController : Controller
    {
        [HttpGet]
        public virtual ActionResult Form()
        {
            return View();
        }
        [HttpGet]
        public virtual ActionResult Details()
        {
            return View();
        }
        // GET: SystemManage/StudentManagement
        public ActionResult Index()
        {

            return View();
        }
        /// <summary>
        /// 获取查询列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [HandlerAjaxOnly]//只允许Ajax访问
        public ActionResult GetTreeSelectJson()
        {
            List<TreeSelectModel> treeList = new StudentManagementbll().GetList();
            return Content(treeList.TreeSelectJson());
        }
        /// <summary>
        /// 获取查询列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [HandlerAjaxOnly]
        public ActionResult GetTreeGridJson()//暂时删除string keyword参数
        {
            List<TreeGridModel> treeList = new StudentManagementbll().GetTreeGridList();
            string str = treeList.TreeGridJson("Grade");
            return Content(str);
        }
        /// <summary>
        /// 获取需要在表单中显示的实体名称
        /// </summary>
        /// <param name="keyValue">实体的ID值</param>
        /// <returns></returns>
        [HttpGet]
        [HandlerAjaxOnly]
        public string GetFormJson(string keyValue)
        {
            //int roleId = OperatorProvider.Provider.GetCurrentNoEncrypt().RoleId.ToInt();//获取当前用户角色ID

            return Code.Json.ToJson(new StudentManagementbll().GetFormJson(keyValue));
        }
        /*
        [HttpGet]
        [HandlerAjaxOnly]
        public ActionResult GetFormJson(string keyValue)
        {
            var data = organizeApp.GetForm(keyValue);
            return Content(data.ToJson());
        }
        [HttpPost]
        [HandlerAjaxOnly]
        [ValidateAntiForgeryToken]
        public ActionResult SubmitForm(OrganizeEntity organizeEntity, string keyValue)
        {
            organizeApp.SubmitForm(organizeEntity, keyValue);
            return Success("操作成功。");
        }
        [HttpPost]
        [HandlerAjaxOnly]
        [HandlerAuthorize]
        [ValidateAntiForgeryToken]
        public ActionResult DeleteForm(string keyValue)
        {
            organizeApp.DeleteForm(keyValue);
            return Success("删除成功。");
        }
        */
    }
}